git reset
命令手册Undo commits or unstage changes, by resetting the current git HEAD to the specified state. If a path is passed, it works as "unstage"; if a commit hash or branch is passed, it works as "uncommit". More information: https://git-scm.com/docs/git-reset.
git reset
git reset {{path/to/file(s)}}
git reset -p {{path/to/file}}
git reset HEAD~
git reset --soft HEAD~2
git checkout
):git reset --hard
git reset --hard {{commit}}